<?php

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class Withdrawal extends Model
{

    protected $table = 'withdrawal';

    protected $fillable = [
        'user_id','usd_amount','del_amount','rmb_amount_received',
        'rate','sp_status','admin_id','amount_type','bank_user',
        'bank_name','bank_number','bank_address','notes','rmb_del_amount',
        'type','usdt_id','usdt_img',
    ];

    const WEICHULI = 0;
    const BOHUI    = 1;
    const TONGUO   = 2;
    const JIAOYIYUER = 1;
    const DAILIYUER  = 2;
    const TOUZHIJER  = 3;


    //处理状态(0未处理1驳回2通过)
    public static $sp_status = [
        self::WEICHULI  =>  '未处理',
        self::BOHUI     =>  '驳回',
        self::TONGUO    =>  '通过',
    ];

    //产品类型(1出售产品2停售产品)
    public static $amount_type = [
        self::JIAOYIYUER    =>  '投资产品', //自己交易帐户赢利结算,
        self::DAILIYUER     =>  '下级产品', //推广别人拿到的佣金
        self::TOUZHIJER     =>  '投入数量', //自身充值的金额
    ];


    public function admin_user()
    {
        return $this->belongsTo(AdminUser::class, 'user_id', 'id');
    }

    public function admin_ids()
    {
        return $this->belongsTo(AdminUser::class, 'admin_id', 'id');
    }


}
